package com.hwua.tonyshop.criteria;
	
import com.slkj.autocode.entity.Page;
import com.hwua.tonyshop.entity.pojo.GoodsClass;

/**
* 
* @author sunny Yang [杨松彦]
* @QQ 550358261
* @date 2018-04-16
* @discribe
* >、<、>=、<=、=、!=、like、
* is null、is not null、in、not in
*
*/
public class GoodsClassCriteria extends GoodsClass{
	/**
	* 版本号
	*/
	private static final long serialVersionUID = 1L;
	private String groupBy123;//分组
	private String having123;//分组过滤
	private String orderBy123;//排序
	private Page page123;
	private String condition123="";//纯条件
	private String selectCondition123;//查询条件
	private String sql123;
	private GoodsClass goodsClass;
	private String feid123;//字段用于统计查询时设置

	public GoodsClassCriteria() {

	}
	public String getFeid123() {
		return feid123;
	}
	public void setFeid123(String feid) {
		this.feid123 = feid;
	}
	public GoodsClass getGoodsClass() {
		return goodsClass;
	}
	public void setGoodsClass(GoodsClass goodsClass) {
		this.goodsClass = goodsClass;
		initGoodsClass(goodsClass);
	}

	public String getSql123() {
		return sql123;
	}

	public void setSql123(String sql123) {
		this.sql123 = sql123;
	}

	public String getSelectCondition123() {
		if(selectCondition123==null){
			if(condition123.trim().length()>0){
				condition123 = "where "+condition123;
			}
			selectCondition123 = condition123;
			if(groupBy123!=null){
				selectCondition123 += " group by "+groupBy123+" ";
			}
			if(having123!=null){
				selectCondition123 += "having "+having123+" ";
			}
			if(orderBy123!=null){
				selectCondition123 += "order by "+orderBy123+" ";
			}
			if(page123!=null){
				selectCondition123 += "limit "+((page123.getPageNumber()-1)*page123.getPageSize())+","+page123.getPageSize();
			}
			selectCondition123 = selectCondition123.trim();
		}
		System.out.println("查询条件："+selectCondition123);
		return selectCondition123;
	}
	public void setSelectCondition123(String selectCondition) {
		this.selectCondition123 = selectCondition;
	}
	public String getCondition123() {
		System.out.println("纯条件："+condition123);
		return condition123;
	}
	public void setCondition123(String condition) {
		this.condition123 = condition;
	}
	public GoodsClassCriteria page(Page value){
		page123 = value;
		return this;
	}
	public GoodsClassCriteria groupBy(String value){
		groupBy123 = value;
		return this;
	}
	public GoodsClassCriteria having(String value){
		having123 = value;
		return this;
	}
	public GoodsClassCriteria orderBy(String value){
		orderBy123 = value;
		return this;
	}

	/*public String getSqlAll(String tableName){
		String sql = "";
		if("where ".equals(condition123)){
			sql = "select * from `"+tableName+"` ";
		}else{
			sql = "select * from `"+tableName+"` "+condition123+" ";
		}
		if(groupBy123!=null){
			sql += sql+" group by "+groupBy123+" ";
		}
		if(having123!=null){
			sql += "having "+having123+" ";
		}
		if(orderBy123!=null){
			sql += "order by "+orderBy123+" ";
		}
		if(page123!=null){
			sql += "limit "+((page123.getPageNumber()-1)*page123.getPageSize())+","+page123.getPageSize();
		}
		sql = sql.trim();
		return sql; 
	}*/

/************以下为纯条件的拼接*******************/

	public GoodsClassCriteria andIdEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`="+id+" ";
			}else{
				condition123 += "`id`="+id+" ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orIdEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`="+id+" ";
			}else{
				condition123 += "`id`="+id+" ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIdNotEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`!="+id+" ";
			}else{
				condition123 += "`id`!="+id+" ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIdNotEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`!="+id+" ";
			}else{
				condition123 += "`id`!="+id+" ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public GoodsClassCriteria andIdGreaterThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`>"+id+" ";
			}else{
				condition123 += "`id`>"+id+" ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIdGreaterThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`>"+id+" ";
			}else{
				condition123 += "`id`>"+id+" ";
			}
		}
		return this;
	}
	
	
	public GoodsClassCriteria andIdLessThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`<"+id+" ";
			}else{
				condition123 += "`id`<"+id+" ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIdLessThan(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`<"+id+" ";
			}else{
				condition123 += "`id`<"+id+" ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIdGreadterThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`>="+id+" ";
			}else{
				condition123 += "`id`>="+id+" ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIdGreadterThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`>="+id+" ";
			}else{
				condition123 += "`id`>="+id+" ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIdLessThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id`<="+id+" ";
			}else{
				condition123 += "`id`<="+id+" ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIdLessThanAndEquals(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id`<="+id+" ";
			}else{
				condition123 += "`id`<="+id+" ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIdLike(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "and `id` like "+id+" ";
			}else{
				condition123 += "`id` like "+id+" ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIdLike(Integer id){
		if(id!=null){
			if(condition123.length()>0){
				condition123 += "or `id` like "+id+" ";
			}else{
				condition123 += "`id` like "+id+" ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIdIsNull(){
			if(condition123.length()>0){
				condition123 += "and `id` is null";
			}else{
				condition123 += "`id` is null";
			}
		return this;
	}
	public GoodsClassCriteria orIdIsNull(){
		if(condition123.length()>0){
			condition123 += "or `id` is null";
		}else{
			condition123 += "`id` is null";
		}
		return this;
	}
	public GoodsClassCriteria andIdIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `id` is not null";
		}else{
			condition123 += "`id` is not null";
		}
		return this;
	}
	public GoodsClassCriteria orIdIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `id` is not null";
		}else{
			condition123 += "`id` is not null";
		}
		return this;
	}
	public GoodsClassCriteria andIdIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `id` in("+value+") ";
			}else{
				condition123 += "`id` in("+value+") ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIdIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `id` in("+value+") ";
			}else{
				condition123 += "`id` in("+value+") ";
			}
		}
		return this;
	}
	public GoodsClassCriteria andIdNotIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `id` not in("+value+") ";
			}else{
				condition123 += "`id` not in("+value+") ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIdNotIn(String value){
		if(value!=null && value.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `id` not in("+value+") ";
			}else{
				condition123 += "`id` not in("+value+") ";
			}
		}
		return this;
	}

	public GoodsClassCriteria andNameEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`='"+name+"' ";
			}else{
				condition123 += "`name`='"+name+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orNameEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`='"+name+"' ";
			}else{
				condition123 += "`name`='"+name+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andNameNotEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`!='"+name+"' ";
			}else{
				condition123 += "`name`!='"+name+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orNameNotEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`!='"+name+"' ";
			}else{
				condition123 += "`name`!='"+name+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public GoodsClassCriteria andNameGreaterThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`>'"+name+"' ";
			}else{
				condition123 += "`name`>'"+name+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orNameGreaterThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`>'"+name+"' ";
			}else{
				condition123 += "`name`>'"+name+"' ";
			}
		}
		return this;
	}
	
	
	public GoodsClassCriteria andNameLessThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`<'"+name+"' ";
			}else{
				condition123 += "`name`<'"+name+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orNameLessThan(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`<'"+name+"' ";
			}else{
				condition123 += "`name`<'"+name+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andNameGreadterThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`>='"+name+"' ";
			}else{
				condition123 += "`name`>='"+name+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orNameGreadterThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`>='"+name+"' ";
			}else{
				condition123 += "`name`>='"+name+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andNameLessThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `name`<='"+name+"' ";
			}else{
				condition123 += "`name`<='"+name+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orNameLessThanAndEquals(String name){
		if(name!=null&&name.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `name`<='"+name+"' ";
			}else{
				condition123 += "`name`<='"+name+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andNameLike(String name){
		if(name!=null&&name.trim().length()>0&&!("%".equals(name.trim()))&&!("%%".equals(name.trim()))){
			if(condition123.length()>0){
				condition123 += "and `name` like '"+name+"' ";
			}else{
				condition123 += "`name` like '"+name+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orNameLike(String name){
		if(name!=null&&name.trim().length()>0&&!("%".equals(name.trim()))&&!("%%".equals(name.trim()))){
			if(condition123.length()>0){
				condition123 += "or `name` like '"+name+"' ";
			}else{
				condition123 += "`name` like '"+name+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andNameIsNull(){
			if(condition123.length()>0){
				condition123 += "and `name` is null";
			}else{
				condition123 += "`name` is null";
			}
		return this;
	}
	public GoodsClassCriteria orNameIsNull(){
		if(condition123.length()>0){
			condition123 += "or `name` is null";
		}else{
			condition123 += "`name` is null";
		}
		return this;
	}
	public GoodsClassCriteria andNameIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `name` is not null";
		}else{
			condition123 += "`name` is not null";
		}
		return this;
	}
	public GoodsClassCriteria orNameIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `name` is not null";
		}else{
			condition123 += "`name` is not null";
		}
		return this;
	}
	
	public GoodsClassCriteria andNameIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `name` in("+value+") ";
			}else{
				condition123 += "`name` in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orNameIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `name` in("+value+") ";
			}else{
				condition123 += "`name` in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andNameNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `name` not in("+value+") ";
			}else{
				condition123 += "`name` not in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orNameNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `name` not in("+value+") ";
			}else{
				condition123 += "`name` not in("+value+") ";
			}
		}
		return this;
	}

	public GoodsClassCriteria andIndexEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`='"+index+"' ";
			}else{
				condition123 += "`index`='"+index+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orIndexEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`='"+index+"' ";
			}else{
				condition123 += "`index`='"+index+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIndexNotEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`!='"+index+"' ";
			}else{
				condition123 += "`index`!='"+index+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIndexNotEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`!='"+index+"' ";
			}else{
				condition123 += "`index`!='"+index+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public GoodsClassCriteria andIndexGreaterThan(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`>'"+index+"' ";
			}else{
				condition123 += "`index`>'"+index+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIndexGreaterThan(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`>'"+index+"' ";
			}else{
				condition123 += "`index`>'"+index+"' ";
			}
		}
		return this;
	}
	
	
	public GoodsClassCriteria andIndexLessThan(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`<'"+index+"' ";
			}else{
				condition123 += "`index`<'"+index+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIndexLessThan(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`<'"+index+"' ";
			}else{
				condition123 += "`index`<'"+index+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIndexGreadterThanAndEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`>='"+index+"' ";
			}else{
				condition123 += "`index`>='"+index+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIndexGreadterThanAndEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`>='"+index+"' ";
			}else{
				condition123 += "`index`>='"+index+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIndexLessThanAndEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `index`<='"+index+"' ";
			}else{
				condition123 += "`index`<='"+index+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIndexLessThanAndEquals(String index){
		if(index!=null&&index.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `index`<='"+index+"' ";
			}else{
				condition123 += "`index`<='"+index+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIndexLike(String index){
		if(index!=null&&index.trim().length()>0&&!("%".equals(index.trim()))&&!("%%".equals(index.trim()))){
			if(condition123.length()>0){
				condition123 += "and `index` like '"+index+"' ";
			}else{
				condition123 += "`index` like '"+index+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orIndexLike(String index){
		if(index!=null&&index.trim().length()>0&&!("%".equals(index.trim()))&&!("%%".equals(index.trim()))){
			if(condition123.length()>0){
				condition123 += "or `index` like '"+index+"' ";
			}else{
				condition123 += "`index` like '"+index+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIndexIsNull(){
			if(condition123.length()>0){
				condition123 += "and `index` is null";
			}else{
				condition123 += "`index` is null";
			}
		return this;
	}
	public GoodsClassCriteria orIndexIsNull(){
		if(condition123.length()>0){
			condition123 += "or `index` is null";
		}else{
			condition123 += "`index` is null";
		}
		return this;
	}
	public GoodsClassCriteria andIndexIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `index` is not null";
		}else{
			condition123 += "`index` is not null";
		}
		return this;
	}
	public GoodsClassCriteria orIndexIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `index` is not null";
		}else{
			condition123 += "`index` is not null";
		}
		return this;
	}
	
	public GoodsClassCriteria andIndexIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `index` in("+value+") ";
			}else{
				condition123 += "`index` in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orIndexIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `index` in("+value+") ";
			}else{
				condition123 += "`index` in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andIndexNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `index` not in("+value+") ";
			}else{
				condition123 += "`index` not in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orIndexNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `index` not in("+value+") ";
			}else{
				condition123 += "`index` not in("+value+") ";
			}
		}
		return this;
	}

	public GoodsClassCriteria andCreateDateEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`='"+createDate+"' ";
			}else{
				condition123 += "`create_date`='"+createDate+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orCreateDateEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`='"+createDate+"' ";
			}else{
				condition123 += "`create_date`='"+createDate+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andCreateDateNotEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`!='"+createDate+"' ";
			}else{
				condition123 += "`create_date`!='"+createDate+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orCreateDateNotEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`!='"+createDate+"' ";
			}else{
				condition123 += "`create_date`!='"+createDate+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public GoodsClassCriteria andCreateDateGreaterThan(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`>'"+createDate+"' ";
			}else{
				condition123 += "`create_date`>'"+createDate+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orCreateDateGreaterThan(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`>'"+createDate+"' ";
			}else{
				condition123 += "`create_date`>'"+createDate+"' ";
			}
		}
		return this;
	}
	
	
	public GoodsClassCriteria andCreateDateLessThan(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`<'"+createDate+"' ";
			}else{
				condition123 += "`create_date`<'"+createDate+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orCreateDateLessThan(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`<'"+createDate+"' ";
			}else{
				condition123 += "`create_date`<'"+createDate+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andCreateDateGreadterThanAndEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`>='"+createDate+"' ";
			}else{
				condition123 += "`create_date`>='"+createDate+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orCreateDateGreadterThanAndEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`>='"+createDate+"' ";
			}else{
				condition123 += "`create_date`>='"+createDate+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andCreateDateLessThanAndEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `create_date`<='"+createDate+"' ";
			}else{
				condition123 += "`create_date`<='"+createDate+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orCreateDateLessThanAndEquals(String createDate){
		if(createDate!=null&&createDate.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `create_date`<='"+createDate+"' ";
			}else{
				condition123 += "`create_date`<='"+createDate+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andCreateDateLike(String createDate){
		if(createDate!=null&&createDate.trim().length()>0&&!("%".equals(createDate.trim()))&&!("%%".equals(createDate.trim()))){
			if(condition123.length()>0){
				condition123 += "and `create_date` like '"+createDate+"' ";
			}else{
				condition123 += "`create_date` like '"+createDate+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orCreateDateLike(String createDate){
		if(createDate!=null&&createDate.trim().length()>0&&!("%".equals(createDate.trim()))&&!("%%".equals(createDate.trim()))){
			if(condition123.length()>0){
				condition123 += "or `create_date` like '"+createDate+"' ";
			}else{
				condition123 += "`create_date` like '"+createDate+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andCreateDateIsNull(){
			if(condition123.length()>0){
				condition123 += "and `create_date` is null";
			}else{
				condition123 += "`create_date` is null";
			}
		return this;
	}
	public GoodsClassCriteria orCreateDateIsNull(){
		if(condition123.length()>0){
			condition123 += "or `create_date` is null";
		}else{
			condition123 += "`create_date` is null";
		}
		return this;
	}
	public GoodsClassCriteria andCreateDateIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `create_date` is not null";
		}else{
			condition123 += "`create_date` is not null";
		}
		return this;
	}
	public GoodsClassCriteria orCreateDateIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `create_date` is not null";
		}else{
			condition123 += "`create_date` is not null";
		}
		return this;
	}
	
	public GoodsClassCriteria andCreateDateIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `create_date` in("+value+") ";
			}else{
				condition123 += "`create_date` in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orCreateDateIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `create_date` in("+value+") ";
			}else{
				condition123 += "`create_date` in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andCreateDateNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `create_date` not in("+value+") ";
			}else{
				condition123 += "`create_date` not in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orCreateDateNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `create_date` not in("+value+") ";
			}else{
				condition123 += "`create_date` not in("+value+") ";
			}
		}
		return this;
	}

	public GoodsClassCriteria andStateEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`='"+state+"' ";
			}else{
				condition123 += "`state`='"+state+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orStateEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`='"+state+"' ";
			}else{
				condition123 += "`state`='"+state+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andStateNotEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`!='"+state+"' ";
			}else{
				condition123 += "`state`!='"+state+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orStateNotEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`!='"+state+"' ";
			}else{
				condition123 += "`state`!='"+state+"' ";
			}
		}
		return this;
	}
	/**
	 * 大于
	 * @param 
	 * @return
	 */
	public GoodsClassCriteria andStateGreaterThan(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`>'"+state+"' ";
			}else{
				condition123 += "`state`>'"+state+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orStateGreaterThan(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`>'"+state+"' ";
			}else{
				condition123 += "`state`>'"+state+"' ";
			}
		}
		return this;
	}
	
	
	public GoodsClassCriteria andStateLessThan(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`<'"+state+"' ";
			}else{
				condition123 += "`state`<'"+state+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orStateLessThan(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`<'"+state+"' ";
			}else{
				condition123 += "`state`<'"+state+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andStateGreadterThanAndEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`>='"+state+"' ";
			}else{
				condition123 += "`state`>='"+state+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orStateGreadterThanAndEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`>='"+state+"' ";
			}else{
				condition123 += "`state`>='"+state+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andStateLessThanAndEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "and `state`<='"+state+"' ";
			}else{
				condition123 += "`state`<='"+state+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orStateLessThanAndEquals(String state){
		if(state!=null&&state.trim().length()>0){
			if(condition123.length()>0){
				condition123 += "or `state`<='"+state+"' ";
			}else{
				condition123 += "`state`<='"+state+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andStateLike(String state){
		if(state!=null&&state.trim().length()>0&&!("%".equals(state.trim()))&&!("%%".equals(state.trim()))){
			if(condition123.length()>0){
				condition123 += "and `state` like '"+state+"' ";
			}else{
				condition123 += "`state` like '"+state+"' ";
			}
		}
		return this;
	}
	public GoodsClassCriteria orStateLike(String state){
		if(state!=null&&state.trim().length()>0&&!("%".equals(state.trim()))&&!("%%".equals(state.trim()))){
			if(condition123.length()>0){
				condition123 += "or `state` like '"+state+"' ";
			}else{
				condition123 += "`state` like '"+state+"' ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andStateIsNull(){
			if(condition123.length()>0){
				condition123 += "and `state` is null";
			}else{
				condition123 += "`state` is null";
			}
		return this;
	}
	public GoodsClassCriteria orStateIsNull(){
		if(condition123.length()>0){
			condition123 += "or `state` is null";
		}else{
			condition123 += "`state` is null";
		}
		return this;
	}
	public GoodsClassCriteria andStateIsNotNull(){
		if(condition123.length()>0){
			condition123 += "and `state` is not null";
		}else{
			condition123 += "`state` is not null";
		}
		return this;
	}
	public GoodsClassCriteria orStateIsNotNull(){
		if(condition123.length()>0){
			condition123 += "or `state` is not null";
		}else{
			condition123 += "`state` is not null";
		}
		return this;
	}
	
	public GoodsClassCriteria andStateIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `state` in("+value+") ";
			}else{
				condition123 += "`state` in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orStateIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `state` in("+value+") ";
			}else{
				condition123 += "`state` in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria andStateNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "and `state` not in("+value+") ";
			}else{
				condition123 += "`state` not in("+value+") ";
			}
		}
		return this;
	}
	
	public GoodsClassCriteria orStateNotIn(String value){
		if(value!=null&&value.trim().length()>0){
			if(value.contains(",")){
				String []values = value.split(",");
				String newValue = "";
				for(String s:values){
					newValue += "'"+s+"',";
				}
				newValue = newValue.substring(0, newValue.length()-1);
				value = newValue;
			}else{
				value = "'"+value+"'";
			}
			if(condition123.length()>0){
				condition123 += "or `state` not in("+value+") ";
			}else{
				condition123 += "`state` not in("+value+") ";
			}
		}
		return this;
	}

	private void initGoodsClass(GoodsClass goodsClass) {
		super.setId(goodsClass.getId());
		super.setName(goodsClass.getName());
		super.setIndex(goodsClass.getIndex());
		super.setCreateDate(goodsClass.getCreateDate());
		super.setState(goodsClass.getState());

	}

}